import React from "react";
import {
    RollbackOutlined,
} from '@ant-design/icons';
import {Space, Flex, Button, Typography, Divider} from "antd";
import { useNavigate } from "react-router-dom";
const {Text} = Typography;

const GoBack = (props) => {
    const  navigate = useNavigate()
    return <div>
        <Flex justify={'space-between'} align={'center'}>
            <Space size={14}>
                <Button onClick={() => navigate(-1)} shape="circle"
                        icon={<RollbackOutlined/>}/>
                <Text style={{fontSize: 18}}>{props.title || ''}</Text>
            </Space>
            <div>
                {props.extra || ''}
            </div>
        </Flex>
        <Divider style={{marginBottom: 0}}/>
    </div>
};

export default GoBack;
